import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

// 查询租户列表
export function listTenant(query) {
  return request({
    url: '/tenant/tenantEnter/selectTenantList',
    method: 'get',
    params: query
  })
}

// 查询租户详细
export function selectTenant(uid) {
  return request({
    url: '/tenant/tenantEnter/selectTenant/' + parseStrEmpty(uid),
    method: 'get'
  })
}

// 新增用户
export function addTenantUser(data) {
  return request({
    url: '/tenant/tenantEnter/addTenantUser',
    method: 'post',
    data: data
  })
}

// 修改用户
export function updateTenantUser(data) {
  return request({
    url: '/tenant/tenantUser',
    method: 'put',
    data: data
  })
}

// 审批租户入驻
export function approveTenant(data) {
  return request({
    url: '/tenant/tenantEnter/approveTenant',
    method: 'put',
    data: data
  })
}

// 删除审批租户
export function deleteTenant(data) {
  return request({
    url: '/tenant/tenantEnter/deleteTenant',
    method: 'post',
    data: data
  })
}
